var topContent = document.querySelector('.TopicH-bottom');
var topRecommend = document.querySelector('.recommend-list');
var topUpdate = document.querySelector('.recentUpdate-list');


function topicContent(array) {
    var str = '';
    for (var i = 0; i < array.length; i++) {
        str += `
        <li>
            <div>
                <p>
                    <img src=${array[i].url[0]} alt="">
                </p>
            </div>
            <div>
                <a href="javascript:void(0)">${array[i].chapter}</a>
            </div>
            <div>
                <i><img src=${array[i].url[1]}></i>
                ${array[i].praise}
            </div>
            <div>${array[i].date}</div>
        </li>
        `;
    }

    topContent.innerHTML = str;
}
topicContent(array)

function topicRecommend(array) {
    var str = '';
    for (var i = 0; i < array.length; i++) {
        str += `
        <li>
            <div>
                <span>
                    <h4>简介:</h4>
                    <p>${array[i].intro}</p>
                </span>
                <img src=${array[i].url[0]} alt="">
            </div>
            <div>${array[i].name}</div>
            <div>
                <span>
                    <img src=${array[i].url[1]} alt="">
                    <p>${array[i].praise}</p>
                    <div class="topic-sanjiao">
                        <a href="">赞: ${array[i].innerPraise}</a>
                        <div></div>
                        <div></div>
                    </div>
                </span>
                <span>
                    <img src=${array[i].url[2]} alt="">
                    <p>${array[i].comments}</p>
                    <div class="topic-sanjiao">
                        <a href="">评论: ${array[i].innerComments}</a>
                        <div></div>
                        <div></div>
                    </div>
                </span>
            </div>
        </li>
        `;
    }
    topRecommend.innerHTML = str;
}
topicRecommend(recommendArr)

function topicUpdate(array) {
    var str = '';
    for (var i = 0; i < array.length; i++) {
        str += `
        <li>
            <div>
                <img src=${array[i].url} title=${array[i].intro}>
            </div>
            <div>
                <p title=${array[i].intro}>${array[i].intro}</p>
                <p>${array[i].date}更新</p>
            </div>
            <div>${array[i].type}</div>
        </li>
        `;
    }
    topUpdate.innerHTML = str;
}
topicUpdate(updateArr)




